﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonForm1.aspx.cs" Inherits="FantastPlatform.Community.UI.InfoCollection.PersonForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
        <script type="text/javascript">
            var pf1 = new FantastPlatform.UI.AddPersonForm({
                renderTo: 'pf1_div',
                Id: '<%=GetId() %>',
                HouseId: '<%=GetHouseId() %>',
                PersonType: '<%=GetPersonType() %>',
                ParentFrom: hpag,
                url: '../Service/PersonService.aspx?Action=AddHousePerson',
                 tbar: [{
                text: '完成',
                iconCls: 'save',
                handler: function () {
                    if (typeof (hpap.HousePersonEditGrid) == 'undefined') {
                        submitPanelJson1(pf1, currtWind, null);
                    } else {
                        submitPanelJson1(pf1, currtWind, hpap.HousePersonEditGrid);
                    } 
                }
            }, '-', {
                text: '重置',
                iconCls: 'cancel',
                handler: function () { pf1.form.reset(); }
            }, '-', {
                text: '自动填写',
                iconCls: 'save',
                tooltip: {
                    text: '根据身份证号码自动填写信息',
                    title: '根据身份证号码自动填写信息',
                    autoHide: true
                },
                handler: function () {
                    if (pf1.form.getValues().IdCard)
                        pf1.form.load({
                            url: '../Service/PersonService.aspx?Action=GetByIdCard',
                            params: { id: pf1.Id, IdCard: pf1.form.getValues().IdCard },
                            waitMsg: '正在读取数据...',
                            waitTitle: '请稍后...',
                            failure: function (form, action) {
                                if (action.failureType != 'client') {
                                    showErrorMessage('操作失败', action.result.message, '');
                                }
                            }
                        });
                }
            }]
            })
  
    </script>
</head>
<body>
    <div id="pf1_div">
    
    </div>
</body>
</html>
